package com.caoJun.ioc.impl;

import com.caoJun.ioc.interfance.UserDao;
import com.caoJun.ioc.interfance.UserService;

/**
 * Description: 依赖注入
 * Created by CJ on 2021/3/7 16:49
 */
public class UserServiceImpl implements UserService {
    // 1.属性
    private UserDao userDao;

    // 2.Setter 方法
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void say() {
        userDao.say();
        System.out.println("DI say hello world");
    }
}
